<?php
/**
 * Created by PhpStorm.
 * User: 跳梁
 * Date: 2016/9/28
 * Time: 16:17
 */
class servicesModule extends Module {
    /*
     * 在构造函数中装载所依赖的类或其他文件
    */
    function __construct() {
        $this->includePhp('services', 'services');
    }


    /*
     * 调用插件资源
    */
    public function call($user, $method, $param) {

        switch ($method) {
            case "servicesCondition"://筛选条件
                services::servicesCondition($param);
                break;
            case "servicesStatistics"://统计
                services::servicesStatistics($param);
                break;
            case "servicesMessageList"://服务列表
                $typeId = $param->typeId;  //服务类型ID
                $divisionId = $param->divisionId;  //服务对象ID
                $start = $param->start;
                $limit = $param->limit;

                services::servicesMessageList($typeId,$divisionId,$start,$limit);
                break;
            case "servicesDetail"://服务详情
                $id=$param->id;
                if (!isset($id)||!$id) {
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                services::servicesDetail($id);
                break;
            case "servicesIndex"://新增服务
                services::servicesIndex($param);
                break;
            case "saveServices"://保存服务
                $managerId = $param->managerId;
                $typeId = $param->typeId;
                $divisionId = $param->divisionId;
                $content = $param->content;
                $image = $param->image;
                $allPerson = $param->allPerson;
                services::saveServices($managerId,$typeId,$divisionId,$content,$image,$allPerson);
                break;
            case "delServicesMassage"://删除服务
                $id = $param->id;
                if (!isset($id)||!$id) {
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
                services::delServicesMassage($id);
                break;
        }
    }
}


$module = new servicesModule();
Module::addModule($module);
?>